package com.sz.biz.rpt.service.impl;

import com.sz.biz.rpt.entity.RptSaleCustomer;
import com.sz.biz.rpt.entity.RptSaleSupplier;
import com.sz.biz.rpt.service.RptSaleCustomerService;
import com.sz.common.base.service.AbstractService;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Function: //TODO ADD FUNCTION. <br>
 * Date: 2017年12月05日 11:47 <br>
 * Author: wentao.chang
 */
@Service
public class RptSaleCustomerServiceImpl extends AbstractService implements RptSaleCustomerService {
    @Override
    public int save(RptSaleCustomer rsc) {
        return dao.save("RptSaleCustomerMapper.insert", rsc);
    }

    @Override
    public int update(RptSaleCustomer rsc) {
        return dao.update("RptSaleCustomerMapper.updateById", rsc);
    }

    @Override
    public int delete(int id) {
        return dao.delete("RptSaleCustomerMapper.deleteById", id);
    }

    @Override
    public RptSaleCustomer findById(int id) {
        return (RptSaleCustomer) dao.findForObject("RptSaleCustomerMapper.selectById", id);
    }

    @Override
    public void deleteByDate(Date dateBegin) {
        dao.delete("RptSaleCustomerMapper.deleteByDate", dateBegin);
    }

    @Override
    public List<RptSaleCustomer> findByParam(Map<String, Object> params) {
        return dao.findForList("RptSaleCustomerMapper.findByParam", params, RptSaleCustomer.class);
    }
}
